import React from "react";
import lazyLoad from "@/routers/utils/lazyLoad";
import { LayoutIndex } from "@/routers/constant";
import { RouteObject } from "@/routers/interface";

// dashboard 模块
const dashboardRouter: Array<RouteObject> = [
	{
		element: <LayoutIndex />,
		meta: {
			title: "Dashboard"
		},
		path: "/userManage",
		icon: "UserOutlined",
		name: "用户管理",
		children: [
			{
				path: "/userManage/list",
				element: lazyLoad(React.lazy(() => import("@/views/dashboard/embedded/index"))),
				meta: {
					requiresAuth: true,
					title: "页面2",
					key: "embedded"
				},
				icon: "AppstoreOutlined",
				name: "用户列表"
			},
			{
				path: "/userManage/add",
				element: lazyLoad(React.lazy(() => import("@/views/dashboard/dataVisualize/add"))),
				meta: {
					requiresAuth: true,
					title: "新增",
					key: "/embedded/add"
				},
				icon: "AppstoreOutlined",
				name: "新增用户",
				isDetail: true
			},
			{
				path: "/userManage/edit",
				element: lazyLoad(React.lazy(() => import("@/views/dashboard/dataVisualize/edit"))),
				meta: {
					requiresAuth: true,
					title: "编辑",
					key: "/embedded/edit"
				},
				icon: "AppstoreOutlined",
				name: "编辑用户",
				isDetail: true
			}
		]
	}
];

export default dashboardRouter;
